package com.zzl.finance.data.dto;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.zzl.apidoc.annotation.ApidocModel;
import com.zzl.apidoc.annotation.ApidocModelProperty;
import com.zzl.apidoc.constants.RequiredType;
import com.zzl.finance.data.constant.ApproveStatusConstant;
import com.zzl.finance.data.constant.ProgressStatusEnum;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.util.Date;

/**
 * @author ：hyt
 * @description：供票企业
 * @date ：2022/2/16 18:53
 */
@Data
@ApidocModel
@SuppressWarnings("javadoc")
public class VoucherEnterpriseUpdateDto {

    @ApidocModelProperty(description = "企业id")
    private String id;
    @NotBlank(message = "企业规模不能为空")
    @ApidocModelProperty(description = "企业规模", required = RequiredType.TRUE)
    private String scale;
    @NotBlank(message = "企业邮箱不能为空")
    @ApidocModelProperty(description = "企业邮箱", required = RequiredType.TRUE)
    private String enterpriseEmail;
    @NotBlank(message = "企业邮箱不能为空")
    @ApidocModelProperty(description = "企业电话", required = RequiredType.TRUE)
    private String enterprisePhone;
    @ApidocModelProperty(description = "传真")
    private String fax;
    @ApidocModelProperty(description = "地区code")
    private String areaId;
    @ApidocModelProperty(description = "企业地址省市")
    private String province;
    @ApidocModelProperty(description = "注册城市")
    private String city;
    @ApidocModelProperty(description = "注册区县")
    private String area;
    @ApidocModelProperty(description = "企业注册详细地址")
    private String address;
    @ApidocModelProperty(description = "实际办公地址")
    private String mailAddress;

    @NotBlank(message = "营业执照文件不能为空")
    @ApidocModelProperty(description = "营业执照文件唯一标识", required = RequiredType.TRUE)
    private String businessLicense;
    @NotBlank(message = "管理员委托授权书不能为空")
    @ApidocModelProperty(description = "管理员委托授权书 唯一标识", required = RequiredType.TRUE)
    private String adminPowerAttorney;
    @NotBlank(message = "法人身份证正面不能为空")
    @ApidocModelProperty(description = "法人身份证正面唯一标识", required = RequiredType.TRUE)
    private String frontIdentityCard;
    @NotBlank(message = "法人身份证反面不能为空")
    @ApidocModelProperty(description = "法人身份证反面唯一标识", required = RequiredType.TRUE)
    private String backIdentityCard;
    @NotBlank(message = "管理员证件正面不能为空")
    @ApidocModelProperty(description = "管理员证件正面唯一标识", required = RequiredType.TRUE)
    private String certificatesFront;
    @NotBlank(message = "管理员证件反面不能为空")
    @ApidocModelProperty(description = "管理员证件反面唯一标识", required = RequiredType.TRUE)
    private String certificatesBack;
    @NotBlank(message = "企业id不能为空")
    @ApidocModelProperty(description = "企业id", required = RequiredType.TRUE)
    private String enterpriseId;
    /**
     * 企业冻结状态，0未冻结 1 冻结
     */
    private Integer enterpriseFreezingStatus;
    @ApidocModelProperty(description = "企业名称")
    @NotEmpty(message = "企业名称不能为空")
    private String enterpriseName;
    @ApidocModelProperty(description = "社会统一代码")
    private String socialCreditCode;
    @JsonIgnore
    private Integer progressStatus;
    @ApidocModelProperty(description = "进度状态名称：1 注册账号 2 管理员认证 3 资料完善 4 平台审核 5 打款认证 6 完成认证")
    private String progressStatusName;
    @JsonIgnore
    private Integer approveStatus;
    @ApidocModelProperty(description = "企业类别0.核心企业 1.供应商，2 集团  3 平台")
    private Integer category;
    @ApidocModelProperty(description = "核心企业上级集团")
    private String enterpriseParentId;
    @ApidocModelProperty(description = "审核状态，0平台审核中，1认证成功，2审核未通过")
    private String approveStatusName;
    @ApidocModelProperty(description = "审核备注")
    private String approveRemark;

    @ApidocModelProperty(description = "申请人id")
    private Integer creatorId;
    @ApidocModelProperty(description = "申请人名称")
    private String creatorName;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApidocModelProperty(description = "提交认证时间", validate = "yyyy-MM-dd HH:mm:ss")
    private Date certificationTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApidocModelProperty(description = "创建时间，即注册时间", validate = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    public String getApproveStatusName() {
        if (null != approveStatus) {
            return ApproveStatusConstant.getValue(approveStatus);
        }
        return "";
    }

    public String getProgressStatusName() {
        if (null != progressStatus) {
            return ProgressStatusEnum.getValue(progressStatus);
        }
        return "";
    }
}
